package com.joysuch.wwyt.edu.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@TableName("wwyt_edu_video_breakpoint_resume")
@NoArgsConstructor
@AllArgsConstructor
public class EduVideoBreakpointResume implements Serializable {
    private Long id;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 视频ID
     */
    private Long videoId;
    /**
     *  创建时间
     */
    private Date createTime;
    /**
     * 备注
     */
    private String remark;
    /**
     * 观看时间
     */
    private String watchTime;
    /**
     * 预留字段
     */
    private String name2;
    /**
     * 预留字段
     */
    private String name3;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    @Column(name = "user_id")
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    @Column(name = "video_id")
    public Long getVideoId() {
        return videoId;
    }

    public void setVideoId(Long videoId) {
        this.videoId = videoId;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Column(name = "watch_time")
    public String getWatchTime() {
        return watchTime;
    }

    public void setWatchTime(String watchTime) {
        this.watchTime = watchTime;
    }
    @Column(name = "name2")
    public String getName2() {
        return name2;
    }

    public void setName2(String name2) {
        this.name2 = name2;
    }
    @Column(name = "name3")
    public String getName3() {
        return name3;
    }

    public void setName3(String name3) {
        this.name3 = name3;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EduVideoBreakpointResume that = (EduVideoBreakpointResume) o;
        return Objects.equals(id, that.id) && Objects.equals(userId, that.userId) && Objects.equals(videoId, that.videoId) && Objects.equals(createTime, that.createTime) && Objects.equals(remark, that.remark) && Objects.equals(watchTime, that.watchTime) && Objects.equals(name2, that.name2) && Objects.equals(name3, that.name3);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, videoId, createTime, remark, watchTime, name2, name3);
    }

    @Override
    public String toString() {
        return "EduVideoBreakpointResume{" +
                "id=" + id +
                ", userId=" + userId +
                ", videoId=" + videoId +
                ", createTime=" + createTime +
                ", remark='" + remark + '\'' +
                ", watchTime='" + watchTime + '\'' +
                ", name2='" + name2 + '\'' +
                ", name3='" + name3 + '\'' +
                '}';
    }
}
